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

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

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.u: D = None
        self.t: G = None
        self.o: F = None
        self.s: F = None
        self.z: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.o: D = None
        self.txt = txt

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

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

j = A("j")
a = B("a")
m = C("m")
d = D("d")
n = E("n")
b = F("b")
f = G("f")
k = C("k")
h = B("h")

j.x = b
j.p = b
j.v = h
j.w = d
j.z = m
a.t = h
a.x = b
a.v = b
a.z = d
m.q = b
m.o = b
m.s = b
m.z = b
m.u = d
m.t = f
d.o = j
d.z = m
n.t = d
n.o = d
b.r = h
b.s = d
f.p = b
k.q = b
k.o = b
k.s = b
k.z = b
k.u = d
k.t = f
h.t = a
h.x = b
h.v = b
h.z = d
assert k.z.r.t.t.t.z.o.txt == "
class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.v: B = None
        self.w: D = None
        self.z: C = None
        self.p: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.u: D = None
        self.t: G = None
        self.o: F = None
        self.s: F = None
        self.z: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.o: D = None
        self.txt = txt

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

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

j = A("j")
a = B("a")
m = C("m")
d = D("d")
n = E("n")
b = F("b")
f = G("f")
k = C("k")
h = B("h")

j.x = b
j.p = b
j.v = h
j.w = d
j.z = m
a.t = h
a.x = b
a.v = b
a.z = d
m.q = b
m.o = b
m.s = b
m.z = b
m.u = d
m.t = f
d.o = j
d.z = m
n.t = d
n.o = d
b.r = h
b.s = d
f.p = b
k.q = b
k.o = b
k.s = b
k.z = b
k.u = d
k.t = f
h.t = a
h.x = b
h.v = b
h.z = d
assert k.z.r.t.t.t.z.o.txt == "j"