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

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.t: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.r: D = None
        self.p: F = None
        self.z: D = None
        self.txt = txt

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

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

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

l.y = i
l.r = h
l.q = h
l.t = e
h.t = d
h.v = i
h.q = i
h.u = b
h.y = m
m.w = l
j.p = m
j.t = i
n.y = h
n.r = b
n.z = b
n.p = e
e.z = d
e.y = l
i.o = l
i.w = l
i.v = m
i.x = h
i.u = b
i.t = n
d.z = e
d.y = l
b.p = m
b.t = i
assert d.z.y.y.u.txt == "
class A:
    def __init__(self, txt: str):
        self.y: G = None
        self.r: B = None
        self.t: F = None
        self.q: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.t: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.r: D = None
        self.p: F = None
        self.z: D = None
        self.txt = txt

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

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

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

l.y = i
l.r = h
l.q = h
l.t = e
h.t = d
h.v = i
h.q = i
h.u = b
h.y = m
m.w = l
j.p = m
j.t = i
n.y = h
n.r = b
n.z = b
n.p = e
e.z = d
e.y = l
i.o = l
i.w = l
i.v = m
i.x = h
i.u = b
i.t = n
d.z = e
d.y = l
b.p = m
b.t = i
assert d.z.y.y.u.txt == "b"