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

class B:
    def __init__(self, txt: str):
        self.t: G = None
        self.z: F = None
        self.v: F = None
        self.w: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.q: A = None
        self.t: G = None
        self.o: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: G = None
        self.x: B = None
        self.p: C = None
        self.q: D = None
        self.v: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: A = None
        self.t: B = None
        self.q: D = None
        self.txt = txt

f = A("f")
m = B("m")
b = C("b")
g = D("g")
j = E("j")
i = F("i")
d = G("d")
l = A("l")

f.t = d
m.t = d
m.z = i
m.v = i
m.w = i
b.y = j
b.o = f
g.s = m
g.q = f
g.t = d
g.o = l
j.x = d
j.q = d
j.u = m
j.v = b
i.z = d
i.x = m
i.v = m
i.p = b
i.q = g
d.z = l
d.t = m
d.q = g
l.t = d
assert i.p.o.t.t.txt == "
class A:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: G = None
        self.z: F = None
        self.v: F = None
        self.w: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.q: A = None
        self.t: G = None
        self.o: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: G = None
        self.x: B = None
        self.p: C = None
        self.q: D = None
        self.v: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: A = None
        self.t: B = None
        self.q: D = None
        self.txt = txt

f = A("f")
m = B("m")
b = C("b")
g = D("g")
j = E("j")
i = F("i")
d = G("d")
l = A("l")

f.t = d
m.t = d
m.z = i
m.v = i
m.w = i
b.y = j
b.o = f
g.s = m
g.q = f
g.t = d
g.o = l
j.x = d
j.q = d
j.u = m
j.v = b
i.z = d
i.x = m
i.v = m
i.p = b
i.q = g
d.z = l
d.t = m
d.q = g
l.t = d
assert i.p.o.t.t.txt == "m"