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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: E = None
        self.v: B = None
        self.p: B = None
        self.x: D = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: E = None
        self.v: B = None
        self.p: B = None
        self.x: D = None
        self.txt = txt

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

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

h.w = m
h.o = g
h.v = b
m.t = f
m.z = f
m.p = f
m.s = j
m.r = b
g.z = n
g.x = d
j.t = g
i.o = d
i.v = b
i.p = m
i.x = f
n.t = b
n.r = b
d.o = i
d.v = b
d.p = b
d.x = j
b.t = f
b.p = f
b.s = j
b.z = j
b.r = m
f.t = g
assert b.z.t.z.r.txt == "b"