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

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.y: E = None
        self.t: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.u: B = None
        self.v: E = None
        self.w: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

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

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

i.t = h
i.u = h
i.s = n
b.q = h
b.y = h
b.t = n
n.t = b
n.u = b
n.v = h
n.w = l
c.y = n
h.w = l
d.p = l
l.r = h
l.y = n
l.z = i
l.o = i
assert i.t.w.o.t.w.y.w.txt == "
class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.s: C = None
        self.u: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.y: E = None
        self.t: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.u: B = None
        self.v: E = None
        self.w: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

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

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

i.t = h
i.u = h
i.s = n
b.q = h
b.y = h
b.t = n
n.t = b
n.u = b
n.v = h
n.w = l
c.y = n
h.w = l
d.p = l
l.r = h
l.y = n
l.z = i
l.o = i
assert i.t.w.o.t.w.y.w.txt == "l"