class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.o: C = None
        self.z: E = None
        self.t: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: A = None
        self.v: G = None
        self.r: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.q: D = None
        self.r: E = None
        self.y: A = None
        self.u: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.x: F = 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.u: A = None
        self.y: F = None
        self.o: D = None
        self.w: D = None
        self.z: F = None
        self.x: F = None
        self.p: B = None
        self.txt = txt

l = A("l")
c = B("c")
e = C("e")
f = D("f")
a = E("a")
g = F("g")
n = G("n")
h = C("h")

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

class B:
    def __init__(self, txt: str):
        self.t: A = None
        self.v: G = None
        self.r: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.q: D = None
        self.r: E = None
        self.y: A = None
        self.u: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.x: F = 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.u: A = None
        self.y: F = None
        self.o: D = None
        self.w: D = None
        self.z: F = None
        self.x: F = None
        self.p: B = None
        self.txt = txt

l = A("l")
c = B("c")
e = C("e")
f = D("f")
a = E("a")
g = F("g")
n = G("n")
h = C("h")

l.x = a
l.z = a
l.o = e
l.t = h
c.t = l
c.v = n
c.r = a
e.p = n
e.q = f
e.r = a
e.y = l
e.u = c
f.s = l
f.y = c
a.r = f
a.x = g
g.p = n
n.u = l
n.y = g
n.z = g
n.x = g
n.o = f
n.w = f
n.p = c
h.p = n
h.q = f
h.r = a
h.y = l
h.u = c
assert a.x.p.u.txt == "l"