class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.o: B = None
        self.z: A = None
        self.v: F = None
        self.y: B = None
        self.t: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.v: B = None
        self.s: E = None
        self.u: A = None
        self.q: F = None
        self.txt = txt

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

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

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

f = A("f")
c = B("c")
i = C("i")
a = D("a")
l = E("l")
j = F("j")
h = G("h")

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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.o: B = None
        self.z: A = None
        self.v: F = None
        self.y: B = None
        self.t: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.v: B = None
        self.s: E = None
        self.u: A = None
        self.q: F = None
        self.txt = txt

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

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

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

f = A("f")
c = B("c")
i = C("i")
a = D("a")
l = E("l")
j = F("j")
h = G("h")

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