class A:
    def __init__(self, txt: str):
        self.u: A = None
        self.y: A = None
        self.r: E = None
        self.o: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.y: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.u: E = None
        self.t: B = None
        self.q: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: D = None
        self.r: C = None
        self.t: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.s: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.v: E = None
        self.txt = txt

d = A("d")
c = B("c")
i = C("i")
e = D("e")
l = E("l")
g = F("g")
b = D("b")
h = A("h")

d.u = h
d.y = h
d.r = l
d.o = l
c.q = h
c.y = g
i.x = b
i.u = l
i.t = c
i.q = g
e.v = b
e.r = i
e.t = g
l.t = b
l.s = d
g.y = c
g.v = l
b.v = e
b.r = i
b.t = g
h.u = d
h.y = d
h.r = l
h.o = l
assert l.t.r.u.t.r.t.txt == "
class A:
    def __init__(self, txt: str):
        self.u: A = None
        self.y: A = None
        self.r: E = None
        self.o: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.y: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.u: E = None
        self.t: B = None
        self.q: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: D = None
        self.r: C = None
        self.t: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.s: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.v: E = None
        self.txt = txt

d = A("d")
c = B("c")
i = C("i")
e = D("e")
l = E("l")
g = F("g")
b = D("b")
h = A("h")

d.u = h
d.y = h
d.r = l
d.o = l
c.q = h
c.y = g
i.x = b
i.u = l
i.t = c
i.q = g
e.v = b
e.r = i
e.t = g
l.t = b
l.s = d
g.y = c
g.v = l
b.v = e
b.r = i
b.t = g
h.u = d
h.y = d
h.r = l
h.o = l
assert l.t.r.u.t.r.t.txt == "c"